<!--
  ~ Copyright (c) 2023 QMJY.
  ~
  ~  Licensed under the Apache License, Version 2.0 (the "License");
  ~  you may not use this file except in compliance with the License.
  ~  You may obtain a copy of the License at
  ~
  ~        https://www.apache.org/licenses/LICENSE-2.0
  ~
  ~   Unless required by applicable law or agreed to in writing, software
  ~   distributed under the License is distributed on an "AS IS" BASIS,
  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~   See the License for the specific language governing permissions and
  ~   limitations under the License.
  -->

<!DOCTYPE html>
<html lang="zh-Hans-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>瓦片数据库列表</title>
    <link rel="stylesheet" type="text/css" th:href="@{/static/css/style.css}">
</head>
<body>
<h1>瓦片数据库列表</h1>
<hr>

<table th:if="${tileFiles}" style="border-spacing:10px">
    <tr>
        <th>名称</th>
        <th>mapbox</th>
        <th>openlayer</th>
        <th>文件格式</th>
        <th>文件大小</th>
        <th>元数据</th>
        <th>瓦片地址</th>
    </tr>
    <tr th:each="file : ${tileFiles}">
        <td th:text="${file.getName()}"></td>
        <td><a th:href="@{'/mapbox/'+${file.getName()}}">预览</a></td>
        <td><a th:href="@{'/openlayers/'+${file.getName()}}">预览</a></td>
        <td th:text="${file.getType()}"></td>
        <td th:text="${file.getFileSize()}" style="text-align:right"></td>
        <td></td>
        <td th:if="${file.getType()=='.mbtiles'}" th:text="'/tilesets/' + ${file.getName()} + '/{z}/{x}/{y}.' + ${file.getMetaDataMap()==null?'':file.getMetaDataMap().get('format')}"></td>
    </tr>
</table>

<!--/* tileFiles为空时显示 */-->
<div th:unless="${tileFiles}">未检测到瓦片数据库文件</div>
</body>
</html>
